<?php if(!IS_AJAX){?>

<include file="Public:header" />
<style>
    table>tbody>tr>td{
        vertical-align: middle!important;
    }
</style>
<div class="row">
 <div class="col-sm-12 col-md-12 col-lg-12">
    <div class="panel">
      <header class="panel-heading"> 搜索 </header>
      <div class="panel-body">
        <form id="ajaxdatalistform">
          <div class="input-group m-bot15">
            <input type="text" name="keywords" class="form-control">
            <span class="input-group-btn">
            <button type="button" onClick="$('#ajaxdatalistform').trigger('submit');" class="btn btn-default"><i class="fa fa-search"></i></button>
            </span> </div>
            <select class="form-control" onChange="$('#ajaxdatalistform').trigger('submit');" name="level" id="level">
          <option value="9999">请选择级别</option>
          <volist name="getLevelNameList" id="vo">
            <option  value="{$key}">{$vo}</option>
          </volist>
        </select>
        </form>
       
      </div>
    </div>
  </div>

  <div class="col-sm-12 col-md-12 col-lg-12">
    <section class="panel">
      <div class="panel-body">
        <table class="table-bordered table" width="100%" border="0" cellspacing="0" cellpadding="0">
 <thead>
  <tr>
      <td align="center">昵称</td>
      <td align="center">ID</td>
      <!--<td align="center">资金</td>-->
      <td align="center">级别</td>
            <td align="center">基本信息</td>
            <td align="center">头像</td>


          </tr>
</thead>
          <tbody class="ajaxdatalist" id="ajaxdatalist">
            <?php }?>
            <?php if(IS_AJAX){?>
            <!-- 数据主体 -->
            <notempty name="list">
<volist name="list" id="vo"> 
          <tr class="data_list" id="ajaxdatalist-{$vo.id}" style="text-align:center">
            
              <td>{$vo.nickname}</td>
              <td>{$vo.number}</td>
              <!--<td>{$vo.money}</td>-->
              <td>{$vo.levelname}</td>
              <td>
<eq name="vo['VerifyPhone']" value="1">手机号：{$vo.tel}(已验证)<br></eq>
注册时间：{:date('Y-m-d H:i:s',$vo['reg_time'])}</td>
            <td align="center" valign="middle" style="vertical-align:middle"><img src="<empty name="vo['img_url']">/Public/timg.jpg<else/>{$vo.img_url}</empty>" height="50"></td>
         
            
        
         
     
          </tr>
          
        </volist><else/>
<tr><td colspan="6" align="center">暂时无数据</td></tr>
</notempty>
            <?php }?>
            <!-- 数据主体结束 -->

            <?php if(!IS_AJAX){?>
          </tbody>
        </table>
        <div id="ajaxdatalistpages" style="text-align:center;"></div>
      </div>
    </section>
  </div>
 
</div>
<include file="Public:footer" />

<script>
//    $('#ajaxdatalist').ajaxlist({success:function(ret){
//        $('#ajaxdatalistpages').html('<?php echo $pages; ?>');
//    }});
    function sendMsg(){
	    var ids=new Array();
		$('.sall').each(function(index, element) {
            if($(this).prop('checked')){
				ids.push($(this).next('input').val());
			}
        });
		if(ids.length>0){
			$.ajax({
				url:'{:U('sendMsg')}',
				data:'msg='+$('#save-source').val()+'&ids='+ids.toString(),
				type:'POST',
				dataType:"json",
				success: function(data){
					success('成功发送了'+data.info+'条信息！');
				}
			});
		}else{
			error('请选择要发送信息的对象！');
		}
    }
	
	
	function sendCoupon(){
      var ids=new Array();
    $('.sall').each(function(index, element) {
            if($(this).prop('checked')){
        ids.push($(this).next('input').val());
      }
        });
    if(ids.length>0){
      $.ajax({
        url:'{:U("sendCoupon")}',
        data:'coupon_id='+$('#coupon_id').val()+'&ids='+ids.toString(),
        type:'POST',
        dataType:"json",
        success: function(data){
          // success('成功发送了'+data.info+'条信息！');
          if(data.status == 0){
            // 处理错误
            error(data.info);
          }else if(data.status == 1){
            success(data.info);
          }
        }
      });
    }else{
      error('请选择要发送信息的对象！');
    }
    }
    function updatePid(mid){
		if(!confirm('您确定要更新父ID吗？')){
			return false;
		}
		var pid = $('#member_'+mid).val();
		$.post('{:U('updatePid')}',{member_id:mid,pid:pid},function(data){
			if(data.status == 1){
				success(data.info);
			}else{
				error(data.info);
			}
		    
		},'json');
	}
</script>



<style>
    .option a.btn{margin-top:5px;}
	.dropdown-menu li{text-align:left;}
</style>

<div class="modal fade" id="downloadModal" tabindex="-1" role="dialog" aria-labelledby="downloadModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">发送信息</h4>
      </div>
      <div class="modal-body">
        <div id="download-logged" class="" >
          <div class="alert alert-info">输入您要发送的内容，然后点击发送。 </div>
          <p>
            <textarea style="width:100%; height:200px;" id="save-source"></textarea>
          </p>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-success" onClick="sendMsg();">发送</button>
        <button type="button" class="btn btn-default" id="cancel-save-btn" data-dismiss="modal">取消</button>
      </div>
    </div>
    
    
  </div>

</div>


</body></html><?php }?>